home *** CD-ROM | disk | FTP | other *** search
/ Champak 114 / Vol 114.iso / games / retro_ra.swf / scripts / frame_124 / DoAction.as
Encoding:
Text File  |  2010-08-12  |  531 b   |  25 lines

  1. function two(x)
  2. {
  3.    return (9 >= x ? "0" : "") + x;
  4. }
  5. function three(x)
  6. {
  7.    return (99 >= x ? "0" : "") + (9 >= x ? "0" : "") + x;
  8. }
  9. function displaytime(ms)
  10. {
  11.    var sec = Math.floor(ms / 1000);
  12.    ms %= 1000;
  13.    var t = three(ms);
  14.    var min = Math.floor(sec / 60);
  15.    sec %= 60;
  16.    t = two(sec) + ":" + t;
  17.    var hr = Math.floor(min / 60);
  18.    min %= 60;
  19.    t = two(min) + ":" + t;
  20.    return t;
  21. }
  22. _root.totalraceB = displaytime(_root.racetimer);
  23. _root.bestlapB = displaytime(_root.bestlaptime);
  24. stop();
  25.